function configCtrl($scope, $route, $rootScope, $timeout, commonService, $location,$http) {
    	
    $scope.configures = {};
    	
	_log('### configCtrl ###');

	 var renderTable = function(){
		
		var url = 'configure_ws.php'; // TODO
		var params = {
		        wsname: 'getallconfigures', // TODO
		        token: _pageData.tokenKey
		};
		var rootData = 'configures'; // TODO
		
		 _log('### renderTable ###');
		 
		var t = $('table').dataTable( {
	            "ajax":{ 
	                    url: _COMMON.context + url+"?wsname="+params.wsname+"&token="+params.token,
	                    dataSrc: rootData
	                },
	            "columns": [
	                { "data": "name" ,  "sClass" : "center"},
	                { "data": "content" },
	                { "data": "name"}
	            ],
	            "columnDefs": [ 
	                   {
	                       "render": function ( data, type, row ) {
	                	   return '<button title="Edit" type="button" class="btn btn-table-action btn-warning" onclick="_pageFn.onConfigEdit(\''+data+'\')"><i class="fa fa-nontext fa-edit"></i></button>&nbsp;'+
	                   	'<button title="Delete"type="button" class="btn btn-danger btn-table-action" onclick="_pageFn.onConfigDelete(\''+data+'\')"><i class="fa fa-nontext fa-trash-o"></i></button>';
	                       },
	                       "targets": 0
	                   }
	               ],
//			"sScrollY": "300px",
			"sScrollX": "100px",
			"sScrollXInner": "100%",
			"bScrollCollapse": true,
			"bPaginate": true,
			"sPaginationType": "full_numbers"
	                      
	        } );
		
//		new $.fn.dataTable.FixedColumns( t, {
//	        	"iLeftColumns": 1,
//	        	"iRightColumns": 0
//	        } );
		
	    };

    _pageFn.onConfigEdit = function(name) {
	location = '#/admin/configure/configure?name='+name;
    };


    _pageFn.onConfigDelete = function (id) {

        $("#confirm").html("Do you want to delete ?");

        $("#confirm").dialog({
        resizable: false,
        modal: true,
        title: "Confirm Delete",
        height: 180,
        width: 300,
        buttons: {
            "Yes": function () {
                $(this).dialog('close');
                callback(id);
            },
                "No": function () {
                $(this).dialog('close');
            }
        }
    });
    };
       
    
    function callback(value) {
	 
        if (value != '') {
      
             var config = {
	            params : {
		        wsname : 'deleteconfigure',
		        token : _pageData.tokenKey,
		        'name' : value
	            }
	        };
	
	        $http.post(_COMMON.context + url, null, config)
	          .success(function(obj) {
	              //alert('Delete Success !');
                    notif({
                      msg: "<b><i class='fa fa-thumbs-o-up'></i>  Delete Success !</b>",
                      type: "success",
                      position: "center"
                    });

                    location= '#/admin/configure/list/'; //refresh.

                  })
                  .error(function() {
                      alert('Error is occured, May be database connect is wrong');
                  });
       

        } else {
            alert("Rejected");
        }

    };
    
 // Start Render table 
    renderTable();
    
};
